﻿@model SRF.Admin.Models.User 
@{
    Layout = "~/Views/Shared/_EditDialog.cshtml";  
}
@using SRF.UI.Html
@section header{
    <link href="@Url.Content("~/Scripts/zTree/css/zTreeStyle/zTreeStyle.css")" rel="stylesheet" type="text/css"/>
    <script src="@Url.Content("~/Scripts/zTree/js/jquery.ztree.all-3.5.min.js")" type="text/javascript"></script> 
    <script type="text/javascript" language="javascript">
        function onComplete() {
            $.dialog.close("ok"); //关闭窗口
        }
        function onDialogClose(msg) {
            $.ajaxSubmit();
        }
        function isnull() {
            return $(this).val() == "";
        }
    </script>
}
@using (Ajax.BeginForm("edit", null, new AjaxOptions() { HttpMethod = "Post", OnComplete = "onComplete" }, new { @class = "form-horizontal", style = "" }))
{   
    @Html.HiddenFor(m => m.Id) 
    <table>
        <tr>
            <td>
                <label class="control-label" for="LoginId">
                    登录名:</label>
                @Html.TextBoxFor(m => m.LoginId)
            </td>
            <td>
                <label class="control-label" for="Enabled">
                    有效:</label>
                <label class="checkbox inline">
                    @Html.CheckBoxFor(m => m.Enabled)
                </label>
            </td>
        </tr>
        <tr>
            <td>
                <label class="control-label" for="Name">
                    姓名:</label>
                @Html.TextBoxFor(m => m.Name)
            </td>
            <td>
                <label class="control-label" for="Sex">
                    性别:</label> 
                @Html.EnumDropDownListFor(m => m.Sex)
            </td>
        </tr>
        <tr>
            <td>
                <label class="control-label" for="Email">
                    邮件:</label>
                @Html.TextBoxFor(m => m.Email)
            </td>
            <td>
                <label class="control-label" for="Phone">
                    电话:</label>
                @Html.TextBoxFor(m => m.Phone)
            </td>
        </tr>
        <tr>
            <td>
                <label class="control-label" for="IM">
                    IM:</label>
                @Html.TextBoxFor(m => m.IM)
            </td>
            <td style="width: 300px">
                <label class="control-label" for="DepartmentId">
                    部门:</label>
                    @Html.TreeSelectorFor(m => m.DepartmentId, ViewBag.DepartmentList as IList<SRF.Admin.Models.Department>, m => m.Id, m => m.ParentId, m => m.Name)
            </td>
        </tr>
    </table>
    <p>
        @Html.SelectorFor(m => m.Roles, "选择角色", ViewBag.RoleList as IEnumerable<SelectListItem>)</p>
}